#include <iostream>
using namespace std;
int main()
{
int m,n,ans;
cin>>m>>n;
switch(n)
{
case 0:ans=1;break;
case 1:ans=m;break;
case 2:ans=m*m;break;
case 3:ans=m*m*m;break;
case 4:ans=m*m*m*m;break;
default:ans=-1;
}
if(ans==-1)cout << "???" << endl;
else cout <<ans<<endl;
return 0;
}
